From: Alice Mikhaylenko Date: Tue, 18 Jun 2024 17:39:06 +0000 (+0400) Subject: switch: Add hover styles X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~226^2^2~73 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=cca34af31eda6538c657b6d6687aac39d08ea10c;p=gnome-shell.git switch: Add hover styles Same as checkboxes. Closes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6455 Part-of: --- diff --git a/data/theme/gnome-shell-sass/widgets/_switches.scss b/data/theme/gnome-shell-sass/widgets/_switches.scss index 31e4de05a..28416b5c8 100644 --- a/data/theme/gnome-shell-sass/widgets/_switches.scss +++ b/data/theme/gnome-shell-sass/widgets/_switches.scss @@ -11,8 +11,16 @@ $switch_handle_size: 20px; @if $contrast == 'high' { background: transparentize(if($variant == 'light', black, white), .7); + + &:hover { + background: transparentize(if($variant == 'light', black, white), .6); + } } @else { background: transparentize(if($variant == 'light', black, white), .85); + + &:hover { + background: transparentize(if($variant == 'light', black, white), .8); + } } StIcon { @@ -33,6 +41,11 @@ $switch_handle_size: 20px; background: $selected_bg_color; color: $selected_fg_color; + &:hover { + background-color: lighten($selected_bg_color, 5%); + color: lighten($selected_fg_color, 5%); + } + .handle { background: white; } diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js index a37484bbd..bc98be2fc 100644 --- a/js/ui/popupMenu.js +++ b/js/ui/popupMenu.js @@ -343,6 +343,7 @@ export const Switch = GObject.registerClass({ super._init({ style_class: 'toggle-switch', accessible_role: Atk.Role.CHECK_BOX, + track_hover: true, }); const box = new St.BoxLayout({